package org.sbbs.demo.entity;

import jakarta.persistence.*;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class AuditEntityAuditingListener {

    @PostLoad
    private void postLoad(DemoBeanAudit entity) {
        log.info("查询后做些什么 {}", entity);
    }

    @PrePersist
    private void prePersist(DemoBeanAudit entity) {
        log.info("插入前做些什么 {}", entity);
    }

    @PostPersist
    private void postPersist(DemoBeanAudit entity) {
        log.info("插入后做些什么 {}", entity);
    }

    @PreUpdate
    private void preUpdate(DemoBeanAudit entity) {
        log.info("更新前做些什么 {}", entity);
    }

    @PostUpdate
    private void postUpdate(DemoBeanAudit entity) {
        log.info("更新后做些什么 {}", entity);
    }

    @PreRemove
    private void preRemove(DemoBeanAudit entity) {
        log.info("删除前做些什么 {}", entity);
    }

    @PostRemove
    private void postRemove(DemoBeanAudit entity) {
        log.info("删除后做些什么 {}", entity);
    }

}
